/**
 * 
 */
package com.sci.web.action.lefttree;

import java.util.ArrayList;
import java.util.List;

import com.opensymphony.xwork2.ActionContext;
import com.sci.web.action.util.BaseAction;
import com.sci.web.bean.Menu;
import com.sci.web.bean.Permission;

/**
 * @author BaiFuyou
 * @date: Sep 23, 2011 2:36:17 PM
 * 
 * 创新型企业年度上报
 */
public class CxxqyndsbTreeAction extends BaseAction {

	/**
	 * 
	 */
	private static final long serialVersionUID = -2083885368081607435L;

	@Override
	public String execute() throws Exception {
		// TODO Auto-generated method stub
		List<Menu> menu = new ArrayList<Menu>();
		Menu CodeClassRuleManage = new Menu("cxxqysjsb", "创新型企业数据上报", true, "partSMLModeing_sml", "创新型企业数据上报");
		Menu codeclassdefi0 = new Menu("cxxqysjcs", "创新型企业数据初审", true, "smlmanage", "创新型企业数据初审");
		Menu codeclassdefi1 = new Menu("cxxqysjzs", "创新型企业数据终审", true, "smlmanage", "创新型企业数据终审");
		Permission p = (Permission) ActionContext.getContext().getSession().get("permission");
		int uc = (Integer) ActionContext.getContext().getSession().get("uc");
		int ur = (Integer) ActionContext.getContext().getSession().get("ur");
		if (uc == -1 && ur == -1) {
			menu.add(CodeClassRuleManage);
			menu.add(codeclassdefi0);
			menu.add(codeclassdefi1);
			String json = super.getJSONArrayString(menu);
			super.setContentType(BaseAction.JSON);
			super.outPrint(json);
			return "json";
		}
		if (p.getDatareport() == 1) {
			menu.add(CodeClassRuleManage);
		}
		if (p.getDatafristcheck() == 1) {
			menu.add(codeclassdefi0);
		}
		if (p.getDatafinalcheck() == 1) {
			menu.add(codeclassdefi1);
		}

		String json = super.getJSONArrayString(menu);
		super.setContentType(BaseAction.JSON);
		super.outPrint(json);
		return "json";
	}

}
